package priv.yangguolong.Chapter06;
import java.util.*;
import javax.swing.*;
import javax.swing.Timer;
public class LambdaTest {
public static void main(String[] args) {
	String[] planets = new String[] {"Mercury","Venus","Earch","Mars","Jupiter",
			"Satuen","Uranus","Meptune"};
	System.out.println(Arrays.deepToString(planets));
	System.out.println("Sorted in diction order:");
	Arrays.parallelSort(planets);
	System.out.println(Arrays.toString(planets));
	System.out.println("Sorted by length:");
	Arrays.sort(planets,(first,second) -> first.length() - second.length());
	System.out.println(Arrays.toString(planets));
	
	Timer t = new Timer(1000,event -> 
	System.out.println("The time is "+new Date()));
	t.start();
	
	//keep program running until user selects "OK"
	JOptionPane.showMessageDialog(null,"Quit program?");
	System.exit(0);
	}
}

